package com.groupfour.attendancemanagementsystem.controller;

import com.groupfour.attendancemanagementsystem.entity.DTO.ClockRecordDTO;
import com.groupfour.attendancemanagementsystem.entity.VO.ClockRecordVO;
import com.groupfour.attendancemanagementsystem.service.ClockRecordService;
import com.groupfour.attendancemanagementsystem.utils.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/admin/attendanceCode")
public class ClockRecordManagementController {
    @Resource
    private ClockRecordService clockRecordService;

    /**
     * @author
     * @param clockRecordDTO
     * @return
     * @describe 查询打卡记录
     */
    @PostMapping("/selectCockRecordDTOByDTO")
    public Result selectClockRecordByDTO(@RequestBody ClockRecordDTO clockRecordDTO){
        List<ClockRecordVO> clockRecordVOList = clockRecordService.selectClockRecord(clockRecordDTO);
        if (clockRecordVOList != null) {
            return Result.ok(clockRecordVOList);
        }
        return Result.fail().message("暂无数据");
    }

    /**
     * @author
     * @describe 导入打卡记录
     */
    public Result importClockRecord() {
        return null;
    }

    /**
     * @author
     * @describe 导出模版
     */
    public Result exportTemplate() {
        return null;
    }


    /**
     * @author
     * @describe 导出打卡记录
     */
    public Result importRecord() {
        return null;
    }
}
